

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Show Content</title>
    </head>
    <body>
        <div class="nav">
            %{--<span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>--}%
            %{--<span class="menuButton"><g:link class="list" action="list">Content List</g:link></span>--}%
            %{--<span class="menuButton"><g:link class="create" action="create">New Content</g:link></span>--}%
        </div>
        <div class="body">
            <h1>Show Content</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table>
                    <tbody>

                    
                        <tr class="prop">
                            <td valign="top" class="name">Id:</td>
                            
                            <td valign="top" class="value">${content.id}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Body:</td>
                            
                            <td valign="top" class="value">${content.body}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Title:</td>
                            
                            <td valign="top" class="value">${content.title}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Date Created:</td>
                            
                            <td valign="top" class="value">${content.dateCreated}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">Last Updated:</td>
                            
                            <td valign="top" class="value">${content.lastUpdated}</td>
                            
                        </tr>
                    
                    </tbody>
                </table>
                
            </div>
            <div class="buttons">
                <!--<g:link controller="comment" action="create"> Add a comment</g:link>-->
                <g:form>
                    <input type="hidden" name="id" value="${content?.id}" />
                    %{--<g:ifUserCanEdit adminRoles="ROLE_ADMINISTRATOR" userName="${content?.createdBy?.username}">--}%
                       <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
                       <span class="button"><g:actionSubmit class="edit" value="Add comment" action="addComment" /></span>
                       <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                    %{--</g:ifUserCanEdit>--}%
                </g:form>


                <g:each var="c" in="${content?.comments}">
                   <p>
                   <hr>
                   <font color="blue"> <h2>${c.title}</h2></font>
                   <div align="right">${c.dateCreated}</div>
                   <br>
                  <font color="#0000FF" size="3">${c.createdBy.username}  says :<br> </font>
                  ${c.body} <br><br><br>

               </g:each>

            </div>
        </div>
    </body>
</html>
